package com.dyh.quickdemo.demos.UnsafeFunc;

import lombok.extern.slf4j.Slf4j;

/*
@Author=Joey Wheeler
@Date=2020/10/30 17:54
*/
@Slf4j
public class UnsafePark {

    public static void main(String[] args) {
        Thread t = Thread.currentThread();
        log.info("before park");
//        UnsafeHelper.getUnsafe().park(true,2000);
//        false=>纳秒
        UnsafeHelper.getUnsafe().park(false,0L);
        log.info("fuck");
        UnsafeHelper.getUnsafe().unpark(t);
        log.info("after unpark");

    }
}
